Add timeout support for filtered orchestration purge - #255
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2af7eb6a-76b9-4c7e-98d6-1efc7e873fc0
There was a problem hiding this comment.
Pull request overview
Adds parity with the underlying gRPC/protobuf contract by exposing a caller-specified timeout on filtered orchestration purge operations in the core Durable Task Python SDK.
Changes:
- Added an optional
timeout: timedelta | Noneparameter to both sync and asyncpurge_orchestrations_by(...)APIs. - Validates
timeoutis positive and serializes it intoPurgeInstanceFilter.timeoutas a protobufDurationwhen provided. - Added unit tests covering serialization, omission behavior, and non-positive timeout validation; documented the user-facing change in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| durabletask/internal/client_helpers.py | Adds timeout validation and protobuf Duration serialization in build_purge_by_filter_req. |
| durabletask/client.py | Plumbs the optional timeout through both sync/async purge_orchestrations_by methods and logs it. |
| tests/durabletask/test_purge_timeout.py | Adds unit coverage for populated/omitted/invalid timeout scenarios for filtered purge APIs. |
| CHANGELOG.md | Documents the new optional timeout capability under ## Unreleased. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Implementation correctly validates and serializes the server-side purge budget for sync and async clients, with no transport deadline or hot-path cost added. I found two non-blocking contract and release-note gaps inline.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 2af7eb6a-76b9-4c7e-98d6-1efc7e873fc0
Bernd Verst (berndverst)
left a comment
There was a problem hiding this comment.
Second-pass review complete at 6a4e68a. The timeout is validated and encoded as the server-side purge budget for both sync and async clients without changing the gRPC deadline; completion presence is preserved as True/False/None; inherited Azure Managed and Azure Functions APIs are documented; and targeted regression, lint, strict type, wire-presence, provider-signature, and CI checks pass.
Summary
Closes #224